Overview
This topic lists the tasks of involved in using the Interop Forms Toolkit to create
.NET forms and make it accessible for use in a Visual Basic
6.0 application. The tasks below walk through project setup and how to expose
different form members to Visual Basic 6.0. The tasks can be
read sequentially, for those new to the Toolkit, or jumped to individually for quick
reference.
Tasks
Configure a .NET InteropForm Project
Generate InteropForm Wrapper Classes
Configure the Visual Basic 6.0 Project
Call an InteropForm Initialize Method
Type Restrictions
One goal of this Interop Forms Toolkit is to keep development simple and
straightforward, allowing developers to spend time developing features that add
value instead of debugging Interop related issues. In keeping with that goal,
only a subset of Types will be supported as parameters or return types for Interop
members. They are:
• Integer (Int32)
• String
• Boolean
• Object
A warning dialog will appear during the code generation process notifying the developer if a member will be skipped because it uses an unsupported type.
Note: Object is supported to allow you to pass any custom object through and cast as needed. An example of this could be to pass a Recordset from Visual Basic 6.0 to .NET.
InteropForm Behavioral Nuances
Since Visual Basic 6.0 Forms and .NET Forms are very different there are a few nuances to keep in mind while developing.
- Bringing a Visual Basic 6.0 Form to the front brings all Visual Basic 6.0 Forms to the front.
- A .NET form showing Visual Basic 6.0 form modally doesn't work. A Visual Basic 6.0 Form is only modal to other Visual Basic 6.0 Forms.
- A Visual Basic 6.0 Form showing another Visual Basic 6.0 Form modally works; however, the modal form only "flickers" to indicate modality when another Visual Basic 6.0 form, not a .NET form, is clicked.
- InteropForms cannot be used as MDI Child forms in Visual Basic 6.0. If you want to extend an MDI Form, use an Interop User Control on a Visual Basic 6.0 MDI Child form and size it to fit the entire client area of the form.
For more information on the working with the .NET InteropForm see The Development Experience.